<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>处理</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="format-detection" content="telephone=no">
  <link rel="stylesheet" href="${s.base}/js/layui/css/layui.css" media="all" />
  <link rel="stylesheet" href="${s.base}/css/base/base.css" media="all" />
  <style status="text/css">
    .layui-form-select dl{z-index: 99999;}
    .pic_img{ width: 120px; height: auto; max-height: 200px; float: left; margin-left: 20px;}
  </style>
</head>
<body class="childrenBody">
<form class="layui-form" style="width:80%;">
  <input type="hidden" id="id" name="id" value="${article.id}" />

  <div class="layui-form-item layui-row layui-col-xs12">
    <label class="layui-form-label">标题</label>
    <div class="layui-input-block">
      <input type="text"  class="layui-input name" readonly value="${article.name}"/>
    </div>
  </div>
  <div class="layui-form-item layui-row layui-col-xs12">
    <label class="layui-form-label">手机号</label>
    <div class="layui-input-block">
      <input type="text"  class="layui-input" readonly value="${article.phone}" />
    </div>
  </div>
  <div class="layui-form-item layui-row layui-col-xs12">
    <label class="layui-form-label">地址</label>
    <div class="layui-input-block">
      <input type="text"  class="layui-input" readonly value="${article.address}" />
    </div>
  </div>
  <div class="layui-form-item layui-row layui-col-xs12">
    <label class="layui-form-label">
      <#if type=="1">
        投诉时间
      </#if>
      <#if type=="2">
        上报时间
      </#if>
    </label>
    <div class="layui-input-block">
      <input type="text"  class="layui-input" readonly value="${article.createTime?string('yyyy-MM-dd HH:mm:ss')}" />
    </div>
  </div>
  <div class="layui-form-item layui-row layui-col-xs12">
    <label class="layui-form-label">事项内容</label>
    <div class="layui-input-block">
      <textarea class="layui-input" readonly >${article.description}</textarea>
    </div>
  </div>
  <div class="layui-form-item layui-row layui-col-xs12">
    <label class="layui-form-label">图片</label>
    <div class="layui-input-block">
      <#list article.pics as pic>
        <a href="${pic}" target="_blank"><img class="pic_img" src="${pic}"></a>
      </#list>

    </div>
  </div>
  <div class="layui-form-item layui-row layui-col-xs12">
    <label class="layui-form-label">类型</label>
    <div class="layui-input-block">
      <select class="form-control" lay-verify="required" id="status">
          <option value="1" <#if "1"==status  >selected</#if> >已上报</option>
        <option value="2" <#if "2"==status  >selected</#if> >已受理</option>
        <option value="3" <#if "3"==status  >selected</#if> >处理中</option>
        <option value="4" <#if "4"==status  >selected</#if> >已办结</option>
      </select>
    </div>
  </div>


  <div class="layui-form-item layui-row layui-col-xs12">
    <div class="layui-input-block">
      <button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="btnSubmit">确定</button>
      <button status="reset" class="layui-btn layui-btn-sm layui-btn-primary closeLay">取消</button>
    </div>
  </div>
</form>
<script status="text/javascript" src="${s.base}/js/layui/layui.js"></script>
<script status="text/javascript" src="${s.base}/js/base/jquery-3.2.0.min.js"></script>
<script status="text/javascript">

    layui.use(['laydate','form','layer'],function(){
        var form = layui.form
        layer = parent.layer === undefined ? layui.layer : top.layer,
            $ = layui.jquery;

        form.on("submit(btnSubmit)",function(data){
            //弹出loading
            var index = top.layer.msg('数据提交中，请稍候',{icon: 16,time:false,shade:0.8});
            // 实际使用时的提交信息
            $.post("/article/updateOrAddEntity",{
                id : $("#id").val(),
                status : $("#status").val()
            },function(result){
                if(1==result.returnInfo.state){
                    top.layer.close(index);
                    top.layer.msg("操作成功！");
                    layer.closeAll("iframe");
                    //刷新父页面
                    parent.location.reload();
                }else{
                    top.layer.msg(result.returnInfo.errorMsg);
                }
            },"json")
            return false;
        });
    })
</script>
</body>
</html>